package lab.gene.action;

import java.util.Date;
import java.util.List;

import lab.gene.pojo.GeneImageFile;
import lab.gene.pojo.GeneWPCRFinals;
import lab.gene.service.impl.GeneImageFileServiceImpl;
import lab.gene.service.impl.GeneWPCRFinalsServiceImpl;

import com.opensymphony.xwork2.ActionSupport;

public class ViewGeneWPCRFinalsAction extends ActionSupport{

	private static final long serialVersionUID = 1L;
	private List<GeneImageFile> imageList = null;
	private String geneName = null;
	private Date recordDate = null;
	private String comments = null;
	private String pno1 = null;
	private String pno2 = null;
	private String strain = null;
	private int exsize;
	
	public String execute() {
		
		System.out.println("ViewGeneWPCRFinalsAction");
		GeneWPCRFinalsServiceImpl service = new GeneWPCRFinalsServiceImpl();
		String formName = null;
		GeneImageFileServiceImpl fService = new GeneImageFileServiceImpl();	
		formName = "W PCR from finals (use TS559 g-DNA)";
		setImageList(fService.getGeneImageFilesByGeneNameAndFormName(geneName, formName));
		GeneWPCRFinals g = null;
		g = service.getGeneWPCRFinalsByName(geneName);
		if (g != null) {
			recordDate = g.getRecordDate();
			comments = g.getComments();
			pno1 = g.getPno1();
			pno2 = g.getPno2();
			strain = g.getStrain();
			exsize = g.getExsize();
		}
		
		return "success";
	}
	public String getGeneName() {
		return geneName;
	}
	public void setGeneName(String geneName) {
		this.geneName = geneName;
	}
	public Date getRecordDate() {
		return recordDate;
	}
	public void setRecordDate(Date recordDate) {
		this.recordDate = recordDate;
	}
	public String getComments() {
		return comments;
	}
	public void setComments(String comments) {
		this.comments = comments;
	}
	public String getPno1() {
		return pno1;
	}
	public void setPno1(String pno1) {
		this.pno1 = pno1;
	}
	public String getPno2() {
		return pno2;
	}
	public void setPno2(String pno2) {
		this.pno2 = pno2;
	}
	public String getStrain() {
		return strain;
	}
	public void setStrain(String strain) {
		this.strain = strain;
	}
	public int getExsize() {
		return exsize;
	}
	public void setExsize(int exsize) {
		this.exsize = exsize;
	}
	public List<GeneImageFile> getImageList() {
		return imageList;
	}
	public void setImageList(List<GeneImageFile> imageList) {
		this.imageList = imageList;
	}

}
